﻿
//extension

Date.prototype.formate = function ( formate ) {
    var date = this;
    formate = formate.replace( 'dd', ( date.getDate() < 10 ? '0' : '' ) + date.getDate() );
    formate = formate.replace( 'MM', ( date.getMonth() < 10 ? '0' : '' ) + ( date.getMonth() + 1 ) );
    formate = formate.replace( 'yyyy', ( date.getFullYear() ) );
    formate = formate.replace( 'hh', ( date.getHours() < 10 ? '0' : '' ) + date.getHours() );
    formate = formate.replace( 'mm', ( date.getMinutes() < 10 ? '0' : '' ) + date.getMinutes() );
    formate = formate.replace( 'ss', ( date.getSeconds() < 10 ? '0' : '' ) + date.getSeconds() );
    return formate;
};

exports.StatusConst = [
    { Key: 'Draft', Name: '草稿', value: 0 },
    { Key: 'Pending', Name: '审批中', value: 1 },
    { Key: 'Approved', Name: '审批通过', value: 2 },
    { Key: 'Rejected', Name: '审批拒绝', value: 3 }
];

exports.AppStatus = {
    Draft: 0,
    Pending: 1,
    Approved: 2,
    Rejected: 3,
    Cancelled: 4
};

exports.Action = {
    Submit: 0,
    Approve: 1,
    Reject: 2,
    Cancel: 3
};

exports.BusinessType = {

    Vacation: 1
};

exports.VacationNode = {
    Start: "Start",
    Manager: "Manager",
    DepartManager: "DepartManager",
    HRD: "HRD"
};